<?
	class OrderPartBO extends BusinessObject {
		function setAttributes(){
			//0 - Not Redeemed
			//1 - Redeemed
			//2 - Cancelled
			$this->fields   = array
            (
				'id' 			  =>	'orpID',
				'order' 	  	  =>	'orpOrder',
				'item'            =>	'orpItem',
				'user'			  =>	'orpUser',		//0 - not home agent, another value = #ID of agent
                'agentID'         =>    'orpAgentID',
                'region'		  =>    'orpRegion',    //"ny" or "gc" region 
                'itemName'		  =>	'orpItemName',
				'itemCode'		  =>	'orpItemCode',
				'date'			  =>	'orpDate',
				'time' 		 	  =>	'orpTime',
				'adult_price'     =>	'orpAdultPrice',
				'adults_count'    =>	'orpAdultsCount',
				'child_price'     =>	'orpChildPrice',	
				'childs_count'    =>	'orpChildsCount',	
				'discount'        =>	'orpDiscount',
				'inHouseDiscount' =>	'orpInHouseDiscount',
				'discount_total'  =>	'orpDiscountTotal',
				'total'           =>	'orpTotal',
				'status'		  =>	'orpStatus',
				'provider'	      =>	'orpProvider',
				'voucher'         =>	'orpVoucher',
				'reedeemDate'	  =>	'orpReedeemDate',
				'reedeemEmpl'	  =>	'orpReedeemEmpl',
				'userName'	      =>	'orpUserName',
				'code'            =>	'orpCode',
				'date1'	          =>	'orpDate1',
				'CCType'	      =>	'orpCCType',
				'status1'	      =>	'orpStatus1',
				'descr'		      =>	'orpDescr',
                'language'        =>    'orplang'
			);

		$item = new ItemBO();
		$empl = new EmplBO ();
		$ip = new ProvItemBO;
		$this->relations = array("{$item->tableName}" => "{$this->tableName}.{$this->fields['item']} = {$item->tableName}.{$item->fields['id']}",
			"{$empl->tableName}" => "{$this->tableName}.{$this->fields['reedeemEmpl']} = {$empl->tableName}.{$empl->fields['id']}",
			"{$ip->tableName}" => "{$this->tableName}.{$this->fields['item']} = {$ip->tableName}.{$ip->fields['item']}"
		);

			BusinessObject::setAttributes();
		}
		/* constructor */
		function OrderPartBO (){
			BusinessObject::BusinessObject ("orderparts");
			 $this->setAttributes();
		}
	}
?>